<?php

/**
 * group model 文件
 * @author Cuil <lntschampion@163.com> 
 * @date 2016-02-15
 */
class M_group extends MY_Model {
	
		public $table = "bjnz_new_admin_group";
	    function M_group() {
	        parent::__construct();
	    }
		
	    //通过组ID获取组信息
	    function get_GroupById($group_id){
	    	
	    	$group = $this->query($this->table,array('group_id'=>$group_id));
	    	if(!empty($group)){
	    		$group = $group[0];
	    	}
	    	return $group;
	    }
	    
	    //通过组名称获取组信息
	    function get_GroupByName($group_name){
	    	 
	    	$group = $this->query($this->table,array('group_name'=>$group_name));
	    	if(!empty($group)){
	    		$group = $group[0];
	    	}
	    	return $group;
	    }
	    //有条件查询列表
	    function query_list($where,$cols,$limit,$offset){
	    		
	    	$group = $this->query($this->table,$where,$cols,$limit,$offset);
	    	return $group;
	    }
	    //无条件查询列表
	    function get_list(){
	    	 
	    	$group = $this->query($this->table);
	    	return $group;
	    }
	    //查询数量
	    function query_count($where){
	    
	    	$group = $this->queryCount($this->table,$where);
	    	return $group;
	    }
	    
	    //插入记录
	    function query_insert($data){
	    	 
	    	$group = $this->insert($this->table,$data);
	    	return $group;
	    }
	    
	    //删除记录
	    function query_delete($where){
	    	 
	    	$group = $this->delete($this->table,$where);
	    	return $group;
	    }
	    //修改记录
	    function query_update($data,$where){
	    	 
	    	$group = $this->update($this->table,$data,$where);
	    	return $group;
	    }
	    
	  
}